package com.yonyou.gmmc.service.pointactivity.controller;


import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.marketing.common.constants.ResultMsgConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMethod;

import com.yonyou.gmmc.service.pointactivity.service.ActivityCommonService;
import com.yonyou.gmmc.service.pointactivity.constant.PointActivityConstant;
import com.yonyou.gmmc.service.pointactivity.util.StringUtils;

import io.swagger.annotations.Api;

@RestController
@RequestMapping(value = PointActivityConstant.BASE_PATH + "/" + PointActivityConstant.VERSION)
@Api("活动通用")
public class ActivityCommonController {
	
	private Logger logger = Logger.getLogger(ActivityCommonController.class);
	
/*	@Autowired
	private ActivityCommonService activityCommonService;
	
	@RequestMapping(value = "/checkUserProgress", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	public @ResponseBody Map<String, Object> checkUserPower(HttpServletRequest req) {

		String openId = req.getHeader(PointActivityConstant.HEADER_OPENID);

		Map<String, Object> resultMap = new HashMap<String, Object>();

		try {

			if (StringUtils.isNull(openId))
				throw new Exception("openId为空.!");

			logger.info("一年内未返厂活动获取到的openId为:" + openId);

			resultMap = activityCommonService.checkUserProgress(openId);

		} catch (Exception e) {
			logger.info("公共模块-判断用户权限,获取到openId:" + openId);
			resultMap.put(ResultMsgConstants.RESULT_CODE, ResultMsgConstants.RESULT_CODE_ERROR);
			resultMap.put(ResultMsgConstants.ERR_MSG, "公共模块-判断用户权限异常");
			resultMap.put(ResultMsgConstants.QUERY_DATA, "");
		}
		return resultMap;
	}*/
}
